// example 32.1 - IR receiver code repeater

// http://tronixstuff.com/tutorials > chapter 32

// based on code by Ken Shirriff - http://arcfn.com

#include <IRremote.h> // use the library

int receiver = 2; // pin 1 of IR receiver to Arduino digital pin 11

IRrecv irrecv(receiver); // create instance of 'irrecv'

decode_results results;

void setup()

{

  Serial.begin(9600); // for serial monitor output

  irrecv.enableIRIn(); // Start the receiver

}

void loop()

{

  if (irrecv.decode(&results)) // have we received an IR signal?

  {

    Serial.println(results.value, HEX); // display it on serial monitor in hexadecimal

    irrecv.resume(); // receive the next value

  }  // Your loop can do other things while waiting for an IR command

}
